@extends('layouts.application')

@section('content')

    @include('shared._sidebar')
    <!-- content start -->
    <div class="admin-content">
        <div class="admin-content-body">

            <h2 class="am-text-primary title_order">维权订单</h2>
            <hr>

            <form class="am-form-inline am-u-sm-offset-0" role="form" method="get">

                <div class="am-form-group search-set">
                    <input type="text" class="am-form-field am-input-sm" name="order_no" placeholder="订单号" value="{{ Request::input('order_no') }}">
                </div>

                <div class="am-form-group search-set">
                    <input type="text" class="am-form-field am-input-sm" name="game_account" placeholder="游戏账号" value="{{ Request::input('game_account') }}">
                </div>


                <div class="am-form-group search-set">
                    <select data-am-selected="{btnSize: 'sm', searchBox: 1}" name="arbitrate_state">
                        <option value="" @if(Request::input('arbitrate_state')=='') selected @endif>仲裁中</option>
                        <option value="1" @if(Request::input('arbitrate_state')=='1') selected @endif>维权失败-不退款</option>
                        <option value="2" @if(Request::input('arbitrate_state')=='2') selected @endif>维权成功-退款</option>
                        <option value="3" @if(Request::input('arbitrate_state')=='3') selected @endif>撤销维权</option>
                    </select>
                </div>

                <div class="am-form-group search-set">
                    <button type="submit" class="am-btn am-btn-secondary am-btn-sm">查 询</button>
                </div>

            </form>
            <hr>

            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-hover am-table-bordered">
                            <thead>
                            <tr>
                                <th>创建时间</th>
                                <th>订单号</th>
                                <th>标题</th>
                                <th>区服</th>
                                <th>买家</th>
                                <th>卖家</th>
                                <th>维权方</th>
                                <th>期望退款额</th>
                                <th>订单总金额</th>
                                <th>维权状态</th>
                                <th>查看详情</th>
                            </tr>
                            </thead>
                            <tbody class="order_table">
                            @foreach($order_arbitrations['data'] as $order_arbitration)
                                <tr class="{!! set_arbitration_calss($order_arbitration['status']) !!}">
                                    <td>{{date('Y-m-d H:i:s', $order_arbitration['create_time'])}}</td>
                                    <td>{{$order_arbitration['order_no']}}</td>
                                    <td>{{$order_arbitration['goods_title']}}</td>
                                    <td>{{$order_arbitration['game_all_name']}}</td>
                                    <td class="am-hide-sm-only">{{$order_arbitration['buyer_username']}}</td>
                                    <td class="am-hide-sm-only">{{$order_arbitration['seller_username']}}</td>
                                    <td>
                                        @if($order_arbitration['arbitration_user_type']=='1')买家
                                        @elseif($order_arbitration['arbitration_user_type']=='2')卖家
                                        @endif
                                    </td>
                                    <td>￥{{$order_arbitration['expect_refund_amount']}}</td>
                                    <td>￥{{$order_arbitration['order_amount']}}</td>
                                    <td>{!! set_arbitration_status($order_arbitration['status']) !!}</td>
                                    <td><a href="{{route('order.arbitration.detail', $order_arbitration['id'])}}">查看详情</a></td>
                                </tr>
                            @endforeach

                            </tbody>
                        </table>

                        <div class="am-cf">
                            共 {{$order_arbitrations['total']}} 条记录
                            <div class="am-fr">
                                {!! $page !!}
                            </div>
                        </div>


                        <footer class="admin-content-footer">
                            <hr>
                            <p class="am-padding-left">© 2017 xubei, Inc. Licensed under MIT license.</p>
                        </footer>


                        <!-- content end -->
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection



